<?php
namespace app\index\model;

class Domain{
    //
    public static function instance(){
        return new Domain();
    }
    //
    public function get($domain){
        $tmp = $this->domainInfo($domain);
        if($tmp){
            $tmp['tdno'] = $this->domainTplno($tmp['tdid']);
        }
        return $tmp;
    }
    //
    private function domainInfo($domain){
        $tmp = db('domain')->where('domain', '=', $domain)->find();//null
        return $tmp;
    }
    //
    private function domainTplno($tdid){
        $tdno = db('tpl_domain')->where('tdid', '=', $tdid)->value('tdno', 'deny');
        return $tdno;
    }
}